package com.itboye.ihomebank;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.itboye.ihomebank.base.BaseFragment;
import com.itboye.ihomebank.myzhujia.ActivityCityLife;
import com.itboye.ihomebank.myzhujia.ActivityHoseKeepingService;
import com.itboye.ihomebank.myzhujia.ActivityLivePayment;
import com.itboye.ihomebank.myzhujia.ActivityRepair;
import com.itboye.ihomebank.myzhujia.ActivitySmartLock;
import com.itboye.ihomebank.myzhujia.ActivityTravel;
import com.itboye.ihomebank.web.WebActivity;

/**
 * 服务
 * 
 */
public class ServiceFragment extends BaseFragment implements OnClickListener {
	ImageView close_icon;
	TextView add_shap_title_tv;
	LinearLayout service_weixiu, server_jiaofei, service_mensuo,
			service_lvxing, server_shenghuo, service_jiazheng;

	@Override
	public int initView() {
		return 0;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		return inflater.inflate(R.layout.service_layout, null);
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);

	}

	@Override
	public void onMyActivityCreated() {
		add_shap_title_tv.setText("住家生活");
		close_icon.setVisibility(View.GONE);
	}

	@Override
	public void onClick(View v) {
		Intent intent;
		switch (v.getId()) {
		case R.id.service_weixiu:// 住家维修
			intent = new Intent(getActivity(), ActivityRepair.class);
			startActivity(intent);
			break;
		case R.id.server_jiaofei:// 生活缴费
			intent = new Intent(getActivity(), ActivityLivePayment.class);
			startActivity(intent);
			break;
		case R.id.service_mensuo:// 智能门锁
			intent = new Intent(getActivity(), ActivitySmartLock.class);
			startActivity(intent);
			break;
		case R.id.service_lvxing:// 签约旅行
			intent = new Intent(getActivity(), WebActivity.class);
			intent.putExtra("url", "http://hzzhongrui.travel.bbcmart.com/");
			intent.putExtra("title", "签约旅行");
			startActivity(intent);
			break;
		case R.id.server_shenghuo:// 城市生活
			intent = new Intent(getActivity(), ActivityCityLife.class);
			startActivity(intent);
			break;
		case R.id.service_jiazheng:// 家政服务
			intent = new Intent(getActivity(), ActivityHoseKeepingService.class);
			startActivity(intent);
			break;

		default:
			break;
		}

	}

}
